<?php
//debug($user);
$u=$user['User'];
$statuses=$formData['statuses'];$hrreferents=$formData['hrreferents'];$users=$formData['users'];
//echo $this->Form->create();
?>

    <fieldset>
        <legend><?php __('Edit User'); ?></legend>
<?php
             echo $this->Form->input('user_name',array('label'=>array('text'=>__('Name',true),'class'=>'required'),'default'=>$u['name'],'name'=>'data[Dmdform][user_name]','id'=>'DmdformUserName'));
             echo $this->Form->input('user_surname',array('label'=>__('Surname',true),'default'=>$u['surname'],'name'=>'data[Dmdform][user_surname]','id'=>'DmdformUserSurname'));
             echo $this->Form->input('user_status_id',array('options'=>$statuses,'empty'=>'select','label'=>__('Status',true),'default'=>$u['status_id'],'name'=>'data[Dmdform][user_status_id]','id'=>'DmdformUserStatusId'));
             echo $this->Form->input('user_contract_begin',array('type'=>'text','empty'=>'select','label'=>__('Contract Begin',true),'default'=>$u['contract_begin'],'name'=>'data[Dmdform][user_contract_begin]','id'=>'DmdformUserContractBegin'));
             echo $this->Form->input('user_contract_end',array('type'=>'text','empty'=>'select','label'=>__('Contract End',true),'default'=>$u['contract_end'],'name'=>'data[Dmdform][user_contract_end]','id'=>'DmdformUserContractEnd'));
             echo $this->Form->input('user_hrreferent_id',array('options'=>$hrreferents,'empty'=>'select','label'=>__('Hrreferent',true),'default'=>$u['hrreferent_id'],'name'=>'data[Dmdform][user_hrreferent_id]','id'=>'DmdformUserHrreferentId'));

            ?><div class="showNextDiv showNextBtn">Not in this list ?</div>
                <div class="isHidden"><?php
             echo $this->Form->input('user_hrreferent_name',array('label'=>__('Hrreferent Name',true),'name'=>'data[Dmdform][user_hrreferent_name]','id'=>'DmdformUserHrreferentName'));
             ?></div><?php
             
             //echo $this->Form->input('user_backup_of',array('label'=>__('Backup Of',true)));

             ?>

            <?php
            // echo $this->Form->input('user_replace',array('label'=>__('Replace',true)));
?>
    </fieldset>

<?php
//echo $this->Form->end();
?>
<script type="text/javascript">
   
     $(function() {
         
		var dates = $( "#DmdformUserContractBegin, #DmdformUserContractEnd" ).datepicker({
			defaultDate: "+1w",
			changeMonth: true,
                        dateFormat: 'yy-mm-dd'});
                    
     });
     
</script>
